/**
 * SSP for WEB
 * Copyright 2015 Baidu Inc. All rights reserved.
 *
 * @file 组件化的ChildViewPanel控件
 * @exports ui.ChildViewPanel
 * @author shenbin(bobshenbin@gmail.com)
 */
define(
    function (require) {
        var u = require('common/util');

        /**
         * @class ui.ChildViewPanel
         * @extends ef.ViewPanel
         */
        var exports = {};

        /**
         * @override
         */
        exports.type = 'ChildViewPanel';

        /**
         * @override
         */
        exports.loadView = function (viewType) {
            var Promise = require('promise');
            var ioc = require('common/ioc');

            var loadingView = new Promise(u.bind(ioc.getComponent, ioc, viewType));

            return loadingView;
        };

        var SuperViewPanel = require('ef/ViewPanel');
        var ChildViewPanel = require('eoo').create(SuperViewPanel, exports);

        require('esui').register(ChildViewPanel);

        return ChildViewPanel;
    }
);
